<?php

/** @var PageInfo $pageInfo */

use App\Util\Helper;
use Plugins\WebSite\Http\PageInfo;

$indexPage = array_filter($pageInfo->getPageList(), function ($page) {
    return !empty($page['isIndex']);
});

$page = Helper::request()->route('page', $indexPage ? $indexPage[0]['page'] : 'index');

ob_start();
include (BASE_PATH . "/plugins/WebSite/Pages/$page.php");
return ob_get_clean();